home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Libraries / MovableModal Library / MovableModal.p < prev    next >
Encoding:
Text File  |  1993-07-28  |  1.8 KB  |  44 lines  |  [TEXT/PJMM]

  1. unit MovableModal;
  2.  
  3. { Pascal interface to the MovableModal.Lib library }
  4.  
  5. { The MovableModal.Lib library includes some simple routines }
  6. { to handle movable modal dialogs in much the same way as non-movable }
  7. { modal dialogs are handled, but following Apple HIGs on the subject }
  8.  
  9. { Written by Marco Piovanelli (piovanel@dsi.unimi.it) }
  10. { ANTIĀ© 1993 Merzwaren }
  11.  
  12. interface
  13.  
  14. { Call DisableMenuBar soon after putting up your movable modal dialog }
  15. { (the frontmost window is assumed to be your dialog) }
  16. { Pass the menu ID of your Edit menu in editMenuID, or 0 if you don't have one }
  17. { DisableMenuBar disables all menus except the system menus (Help, Keyboard }
  18. { and Application).}
  19. { It enables Cut, Copy and Paste in the Edit menu if your dialog contains edit fields }
  20. { Pass the ID of a valid 'hmnu' resource in hmnuID if you want menu help string }
  21. { remapping to take place, as described in "Toolbox M.TB.MovableModalDialog"; }
  22. { otherwise pass -1 (if the Help Manager isn't available, nothing will happen anyway) }
  23.  
  24.     procedure DisableMenuBar (editMenuID: Integer;
  25.                                     hmnuID: Integer);
  26.  
  27. { call ReEnableMenuBar soon after bringing down your movable modal dialog box }
  28. { ReEnableMenuBar will restore the previous enableFlags for all menus in the menu bar }
  29.  
  30.     procedure ReEnableMenuBar;
  31.  
  32. { MovableModalDialog is the routine that does most of the work }
  33. { it's very much like the Toolbox routine ModalDialog in system 7.x }
  34. { MovableModalDialog allows access to the menu bar (even under system 6.0.x) }
  35. { and major context switches }
  36. { you normally will want to know when a context switch takes place while }
  37. { your dialog is in front: to do this, you have to check for events of type osEvt }
  38. { from within your filter procedure }
  39.  
  40.     procedure MovableModalDialog (filterProc: ProcPtr;
  41.                                     var itemHit: Integer);
  42.  
  43. implementation
  44. end.